home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 25
/
AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso
/
PublicDomain
/
Spiele
/
Ambassador
/
Upd140.lha
/
Upd
/
Upd.doc
< prev
next >
Wrap
Text File
|
1994-12-11
|
17KB
|
447 lines
Release 1.40
The minimal player daemon - upd
===============================
© 1991-1994 Jonas Petersson & Absolut Software (aka Sirius Soft)
Introduction:
=============
Wouldn't it be nice to have a process hanging around to play any
sound file for you on demand instead of you having to do all this
mucking about with audio.device etc? But it really has to be small
and it HAS to be able to play my very large samples anytime...
I must be able to call it simply from anywhere - even from scripts!
Tricky, but it can be done.
As a feature you can register you favourite sounds in a configuration
file and well behaved programs will use the ones you like right now.
It also has Arexx support - to be truely honest, that the ONLY way to
use it... As of 1.01, there is also a fade option.
Actually, "minimal" is not quite true anymore as speech is available
starting 1.20... As a spin-off of this you also get a "say" program
that can play phonemes.
1.30 includes a way to preload the samples from disk.
1.40 includes a way to register several IDs to be played at random and
the ability to play every request to the end (disable the lookahead
feature).
Current version works rather well along the way I intended.
Changes:
========
Option -Q turns on Queue mode where every single request is played
to the end no matter how much is queued up. You have been warned.
Specifying a FADE of "-1" gives the same result - obviously queue
and fade are mutually exclusive.
If you register the same ID several times in the ID file (normally
s:UPD.IDs) UPD will pick one of them at random.
Usage:
======
[run] upd [-bBUFSIZE] [-fIDFILE] [-pPRIORITY] [-M] [-Q]
The "run" is of course optional, but daemons really should be in the
background unless you want the see the debugging information. "BUFSIZE"
is the amount of chip memory that each of the four buffers will use
while playing. (These are allocated at start to make sure you will be
able to play anytime - as long as you can get hold of the audio
channels...). Default is 1024 and specifying less than 64 will give you
the default. (I've heard that some people can't ever get anything good
out with less than a 1K buffer - am I really the only one with a quick
enough HD/SCSI interface?)
NOTE: Don't make the buffer bigger than you actually need - a large
buffer also means that the sample will start a little bit later since
more information must be loaded before it can begin!
If the IDfile parameter exists, it will be used instead of the
default s:upd.IDs.
As of 1.20 I've also added the priority option to satisfy some requests
from people who prefer their sound to be perfect before getting things
done... You people may specify -p35 or something like that along with
some huge buffer. Of course, you can also lower priority with this option.
As of 1.30, the -M option can be used to waste your RAM! If present at
startup, upd will always try to find a memory space to load the sample
into before playing it. If that fails the sample will play from disk
as before. This will of course delay the sound a bit as well. For small
samples there is hardly any difference, for medium size samples there
is a delay but no access to the disk while playing, and for large samples
things are just like before. (I don't use this option myself...)
As of 1.40, the -Q option turns om Queue mode from the start.
The above won't produce any sound as you probably realise. Once run, the
only way to talk to upd is with Arexx - I even removed the BREAK stuff
that was in it for Zound, since Arexx could hang around waiting for a
reply forever when you interupted the sound that way. The break will
"wait" until the daemon is idle next time.
upd currently knows of these commands:
file filepath [options] [anotherfilepath [options]]
id id-in-s:upd.IDs
rescan new-id-file
fade #-of-steps-per-bufsize
say string-to-translate-and-say
phoneme phoneme-string-to-say
exit
The 'fade' command is new to 1.01 and might need some explanation:
What is does is merely reconfigure upd for future requests. By default
fade is set to 0 which means that any playing sound will be cut off
as soon as a new AREXX command arrives. Any other number indicates that
when a new request arrives, first fade out the current sound by lowering
the volume by the specified amount by each played buffer until volume reaches
zero. As the observant reader realises, a value exceeding 64 will do
the same thing as 0. As of 1.40 a negative value will put UPD in Queue mode.
'say' and 'phoneme' are new as of 1.20 and their use should be obvious.
These are really just a spin-off from what was added to the ID file.
Speech currently won't fade - I fail to see the beauty in fading it...
NOTE: You must have LIBS:translator.library and DEVS:narrator.device on
your system of this will NOT work.
Well, there is actually one more command: 'Can it, Marvin'. This will
silently interrupt the current sample. (To be truely honest, ANY command
will interrupt a sample - if it's known, it will be used, otherwise the
sound just stops). Note: this does NOT work in Queue mode.
Be careful with the 'rescan' command: if there is a problem reading the
new file, you will have no IDs at all...
The options are the same as for Zound except for the -n option that doesn't
exist here (tell me you need it and I'll fix that too... sigh). Here's the
list:
-r rate How fast to play the sample. Default is what is in the
8SVX header or 310 if it's a raw file. This is usually
reasonable - most 'raw' samples I've come across are either
310 or 155. Lower numbers will play the sample faster.
-v volume Ranges between 0 and 64, 64 being max and default.
-s start Possible offset from the beginning. Default 0.
-l length Possible length unless you want it all. Default is
length of the sample. Be careful with these two, or
you might get undesired results.
-c cycles How many times to play each buffer. Default 1. Not
very useful, but you can get a nice "mouse" effect by
setting this to 2 and playing twice as fast...
-d Toggle debug information. Note that this will appear on
the standard output of the DAEMON, not where you called
it from (that is, the ARexx script or wherever).
-L Play the sample in the left speaker only. If it's a stereo
sample only the left channel samples are used.
-R Same as '-L' but for right speaker.
-S Play in both speakers even if it's a mono sample.
Default for these three options are of course what is in the
8SVX header or -L if it's a raw sample.
Examples:
=========
* Example of usage (from WShell etc):
"address play file 'sounds:chopper'
"address play fade 2
"address play id 2001
"address play rescan 'ram:upd.IDs'
"address play exit
* If you are using the vanilla 2.0 AREXX you might have to create a file
like this:
/* A test script in AREXX */
address PLAY say "Hi there!"
Then execute it with 'rx filename.rexx'
Alternatively, you can give a command like this (note the tick [']):
rx 'address PLAY say "Hi there!"
* Say "emulations":
address play say "-f -r -s100 E T phone home."
address play phoneme "-s200 YUWNAEZ PEH1TERSUN"
NOTE: Arexx normally converts everything to UPPERCASE and might try to
do arithmetics etc on filenames which is why it's generally a good idea
to 'singelquote' all paths, IDs etc. If you're looking for the port
'the hard way' to send your own message, the name is "PLAY" in uppercase.
NOTE2: If you are REALLY in a hurry to get rid of upd you could do this:
1) Send a any dummy Arexx message (this will stop the sound)
2) Send a break C to upd - break still works when upd is idle.
or
A) Send the exit message.
The last might sound much easier than the first unless you (like me)
have a trapped DisplayBeep() that 'pings' via upd. In this case,
producing a DisplayBeep() and a break C is much simpler. The order is
not relevant since the break is "queued".
Hints:
======
Running upd from your SOUNDS: directory is a nice way to get rid of having
you type the FULL path everytime you want to play a sample. (The daemon
has no simple way of knowing WHER